package com.gui;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Gui_1 implements ActionListener {
    JButton jButton;

    public static void main(String[] args) {
        Gui_1 gui_1 = new Gui_1();
        gui_1.go();
    }

    public void go(){
        JFrame jFrame = new JFrame();
        jButton=new JButton("click me");

        jButton.addActionListener(this);

        jFrame.add(jButton);
        jFrame.setDefaultCloseOperation(3);
        jFrame.setSize(300,300);
        jFrame.setVisible(true);

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        jButton.setText("I' ve been clicked");
    }
}
